﻿using BCCommon.Enums.TMS;
using BCEntity.TMS.Fence;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.Fence
{
    public interface IFenceData
    {
        /// <summary>
        /// 删除围栏
        /// </summary>
        /// <param name="fenceId">围栏Id</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(long fenceId);
        /// <summary>
        /// 获取围栏
        /// </summary>
        /// <param name="fenceId">围栏Id</param>
        /// <returns></returns>
        Task<FenceEntity> GetEntityAsync(long fenceId); 
         
        /// <summary>
        /// 添加围栏
        /// </summary>
        /// <param name="entity">围栏模型</param>
        /// <returns></returns>
        Task<FenceEntity> InsertAsync(FenceEntity entity);
        /// <summary>
        /// 修改围栏
        /// </summary>
        /// <param name="entity">围栏模型</param>
        /// <returns></returns>
        Task<FenceEntity> UpdateAsync(FenceEntity entity);
        /// <summary>
        /// 获取mongoDB围栏
        /// </summary>
        /// <param name="mongoId">mongoId</param>
        /// <returns></returns>
        Task<FenceEntity> GetByMongoIdAsync(string mongoId);

        /// <summary>
        /// 获取围栏列表
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="workingCompanyName"></param>
        /// <param name="provinceCode"></param>
        /// <param name="cityCode"></param>
        /// <param name="countyCode"></param>
        /// <param name="fenceName"></param>
        /// <param name="isEnable"></param> 
        /// <returns></returns>
        Task<IEnumerable<FenceEntity>> GetOnlyListAsync(int? companyId, string workingCompanyName, string provinceCode, string cityCode, string countyCode, string fenceName, bool? isEnable);
        /// <summary>
        /// 获取围栏列表 分页
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="workingCompanyName"></param>
        /// <param name="provinceCode"></param>
        /// <param name="cityCode"></param>
        /// <param name="countyCode"></param>
        /// <param name="fenceName"></param>
        /// <param name="isEnable"></param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页行数</param>
        /// <returns></returns>
        Task<(IEnumerable<FenceEntity>, int)> GetListAsync(int? companyId, string workingCompanyName, string provinceCode, string cityCode, string countyCode, string fenceName, bool? isEnable, int pageIndex, int pageSize);

        /// <summary>
        /// 根据劳务公司和区县编码获取围栏信息
        /// </summary>
        /// <param name="workingCompanyId">劳务公司</param>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        Task<FenceEntity> GetByWorkCompanyIdAndCountyCodeAsync(long workingCompanyId, string countyCode);
    }
}